/*
 * All rights Reserved, Designed By DataDriver
 * Copyright:    DataDriver.Inc
 * Company:      Zhuo Wo Infomation Technology (ShangHai) CO.LTD
 */
package com.sun.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class Consumer3001Controller {

    @Autowired
    private RestTemplate restTemplate;

    @Value("${server.url}")
    private String SERVER_URL;

    @RequestMapping("/hello/{id}")
    public String test(@PathVariable("id") int id) {
        return restTemplate.getForObject(SERVER_URL + "/test/" + id, String.class);
    }
}
